<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>会员中心</title>
  <link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>
  <div class="container">
    <header class="header">
      <button class="back-btn" onclick="window.history.back()">←</button>
      <h2>会员中心</h2>
    </header>
    
    <!-- 会员信息卡片 -->
    <div class="vip-card">
      <div class="vip-level">
        <div class="level-icon">⭐️</div>
        <div class="level-info">
          <h3>黄金会员</h3>
          <p>有效期至: 2025-12-31</p>
        </div>
      </div>
      
      <div class="vip-progress">
        <div class="progress-bar">
          <div class="progress" style="width: 65%;"></div>
        </div>
        <div class="progress-info">
          <span>650/1000分</span>
          <span>升级铂金会员</span>
        </div>
      </div>
    </div>
    
    <!-- 会员特权 -->
    <div class="section">
      <h3>会员特权</h3>
      <div class="benefit-list">
        <div class="benefit-item">
          <div class="benefit-icon">🎁</div>
          <div class="benefit-info">
            <h4>专属优惠</h4>
            <p>会员专享折扣与优惠券</p>
          </div>
        </div>
        <div class="benefit-item">
          <div class="benefit-icon">🚗</div>
          <div class="benefit-info">
            <h4>免费配送</h4>
            <p>每月3次免配送费</p>
          </div>
        </div>
        <div class="benefit-item">
          <div class="benefit-icon">💎</div>
          <div class="benefit-info">
            <h4>专属客服</h4>
            <p>24小时VIP专线服务</p>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 积分兑换 -->
    <div class="section">
      <h3>积分兑换</h3>
      <div class="points-grid">
        <div class="points-item" onclick="redeemPoints(10)">
          <div class="points-value">100积分</div>
          <div class="points-desc">5元优惠券</div>
        </div>
        <div class="points-item" onclick="redeemPoints(20)">
          <div class="points-value">200积分</div>
          <div class="points-desc">视频会员月卡</div>
        </div>
        <div class="points-item" onclick="redeemPoints(50)">
          <div class="points-value">500积分</div>
          <div class="points-desc">品牌咖啡券</div>
        </div>
      </div>
    </div>
    
    <!-- 续费按钮 -->
    <button onclick="renewVip()" class="vip-renew-btn">立即续费会员</button>
  </div>
  
  <script>
    // 积分兑换
    function redeemPoints(points) {
      if (confirm(`确认使用${points}积分兑换${points === 10 ? '5元优惠券' : points === 20 ? '视频会员月卡' : '品牌咖啡券'}?`)) {
        alert('兑换成功！');
      }
    }
    
    // 续费会员
    function renewVip() {
      alert('正在打开会员续费页面');
    }
  </script>
  
  <style>
    .vip-card {
      background: linear-gradient(135deg, #ffb700, #ffd700);
      color: #333;
      border-radius: var(--radius-md);
      padding: 20px;
      margin: 20px 0;
      box-shadow: var(--shadow-md);
    }
    
    .vip-level {
      display: flex;
      align-items: center;
      margin-bottom: 20px;
    }
    
    .level-icon {
      font-size: 36px;
      margin-right: 15px;
    }
    
    .level-info h3 {
      font-size: 20px;
      margin-bottom: 5px;
    }
    
    .vip-progress {
      margin-top: 15px;
    }
    
    .progress-bar {
      height: 8px;
      background: #e0e0e0;
      border-radius: 4px;
      overflow: hidden;
    }
    
    .progress {
      height: 100%;
      background: #ff6b00;
    }
    
    .progress-info {
      display: flex;
      justify-content: space-between;
      margin-top: 8px;
      font-size: 12px;
    }
    
    .points-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-top: 10px;
    }
    
    .points-item {
      background: var(--card-bg);
      border-radius: var(--radius-sm);
      padding: 12px;
      text-align: center;
      cursor: pointer;
      transition: var(--transition);
      border: 1px solid var(--border-color);
    }
    
    .points-item:hover {
      transform: translateY(-3px);
      box-shadow: var(--shadow-md);
    }
    
    .points-value {
      font-weight: bold;
      color: var(--primary-color);
      margin-bottom: 5px;
    }
    
    .points-desc {
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .vip-renew-btn {
      width: 100%;
      background: var(--accent-gradient);
      font-size: 16px;
      padding: 12px;
      margin: 20px 0;
    }
  </style>
</body>
</html>